<template>
	<view class="mainpadding2">
		<view class="mainpadding_top ffffff radius" v-for="item in list.data" :key="item.id">
			<view class="flexbetween">
				<view class="sanshier fonweight xiaohuang">
					<text>{{item.username}}</text>
					<text class="margin-left xiaohei">{{item.tel}}</text>
				</view>
				<view class="xiaohuang smalltext" v-if="item.status==1">平台审核中</view>
				<view class="xiaolv smalltext" v-if="item.status==2">审核成功</view>
				<view class="xiaohong smalltext" v-if="item.status==3">审核失败</view>
			</view>
			<view class="margin_top xiaohui ershil">代理区域：{{item.area.mergename_text}}</view>
			<view class="margin_top xiaohui ershil" v-if="item.bz">审核备注：{{item.bz}}</view>
		</view>
		<view class="mainpadding gudingdb">
			<view class="bigbtn" @click="jumpurl('/pages_mypage/shenqingdl')">申请成为合伙人</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			init(isPage, page) {
				let _this = this
				httpRequest.request('/api/user/dlapplyIndex', 'GET', {
					page: page || 1,
					limit: _this.limit,
				}).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			jumpurl(url){
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style>
page{
	background-color: #fefefe;
}
</style>
